<%--
  Created by IntelliJ IDEA.
  rowingmanager.domain.User: Simon
  Date: 20.8.2009
  Time: 2:35:20
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
  <head><title>Register Organization Test page</title>
        <style type="text/css">
          p{
            font-weight:bold;
            text-transform:capitalize;
          }
          #register{
            width:500px;
          }
          #register fieldset label{
            display:block;
            line-height:1.5em;
            float:right;
          }
        </style>
  </head>
  <body>
  <p>Register organization</p>
  <g:if test="${flash?.message}">
      <span style="font-size:2em;color:blue;">${flash?.message}</span>
  </g:if>
  <g:else>
    <g:hasErrors bean="${organization}">
      <g:renderErrors as="list"/>
    </g:hasErrors>
  </g:else>
  <g:form id="register" action="save" method="POST" enctype="multipart/form-data">
    <fieldset>
      <lablel for="input_title">Organization name:</lablel>
      <input id="input_title" name="organization.title" type="text" value="${organization.title}"/>  <br/>

      <label for="input_type">Type:</label>
      <g:select id="input_type"  name="organization.type" from="${['Rowing club','School','College']}" value="${organization?.type}"/> <br/>

      <lablel for="input_taxid">Tax id:</lablel>
      <input id="input_taxid" type="text" name="organization.taxid" value="${organization.taxid}"/><br/>

      <lablel for="input_address">Address line 1:</lablel>
      <input id="input_address" type="text" name="address.street" value="${organization.address.street}"/>    <br/>

      <lablel for="input_phone">Phone</lablel>
      <input id="input_phone" type="text" name="organization.phone" value="${organization.phone}"/>  <br/>

      <lablel for="input_city">City</lablel>
      <input id="input_city" type="text" name="address.city" value="${organization.address.city}"/>  <br/>

      <lablel for="input_state">State</lablel>
      <input id="input_state" type="text" name="address.state" value="${organization.address.state}"/>  <br/>

      <lablel for="input_zip">Postal code</lablel>
      <input id="input_zip" type="text" name="address.postalCode" value="${organization.address.postalCode}"/>  <br/>
      
      <lablel for="input_country">Country</lablel>
      <g:select id="input_country" name="address.country"  from="${clist}" optionKey="id"/>  <br/>
   </fieldset>
      <fieldset>
          <label for="input_email">Email</label>
          <input id="input_email" type="text" name="user.email" value="${flash?.email}"/>   <br/>
        
          <label for="input_password">Password:</label>
          <input id="input_password" type="password" name="user.password"/>    <br/>

          <label for="input_logo">Organization logo:</label>
          <input id="input_logo" name="logo" type="file" />    <br/>
          <g:submitButton name="savebtn" value="Save Organization"/>
      </fieldset>
  </g:form>

  </body>
</html>